# Global variables
	.text
	.data
	.globl matrix
	.align 3
	.type matrix, @object
	.size matrix, 80000000
matrix:
	.space 80000000
	.globl ad
	.align 3
	.type ad, @object
	.size ad, 400000
ad:
	.space 400000
	.globl len
	.align 2
	.type len, @object
	.size len, 4
len:
	.word 0
	.text
	.align 2
	.globl readarray
	.type readarray, @function
readarray:
	addi sp, sp, -64
	sd ra, 56(sp)
	sd s0, 48(sp)
	addi s0, sp, 64
.readarray_label_entry:
# %op0 = alloca i32
	li t0, 28
	sub t1, fp, t0
	sd t1, -24(fp)
# store i32 0, i32* %op0
	ld t1, -24(fp)
	addi t0, zero, 0
	sw t0, 0(t1)
# br label %label1
	j .readarray_label1
.readarray_label1:
# %op2 = load i32, i32* %op0
	ld t0, -24(fp)
	lw t1, 0(t0)
	sw t1, -32(fp)
# %op3 = load i32, i32* @len
	la t0, len
	lw t1, 0(t0)
	sw t1, -36(fp)
# %op4 = icmp slt i32 %op2, %op3
	lw t0, -32(fp)
	lw t1, -36(fp)
	slt t0,t0,t1
	sb t0, -37(fp)
# br i1 %op4, label %label5, label %label11
	lb t0, -37(fp)
	bnez t0, .readarray_label5
	j .readarray_label11
.readarray_label5:
# %op6 = call i32 @getint()
	jal getint
	sw a0, -44(fp)
# %op7 = load i32, i32* %op0
	ld t0, -24(fp)
	lw t1, 0(t0)
	sw t1, -48(fp)
# %op8 = getelementptr [100000 x i32], [100000 x i32]* @ad, i32 0, i32 %op7
	la t1, ad
	lw t0, -48(fp)
	li s11, 4
	li s10, 1
	mul t0, t0, s10
	mul t0, t0, s11
	add t1, t1, t0
	sd t1, -56(fp)
# store i32 %op6, i32* %op8
	ld t1, -56(fp)
	lw t0, -44(fp)
	sw t0, 0(t1)
# %op9 = load i32, i32* %op0
	ld t0, -24(fp)
	lw t1, 0(t0)
	sw t1, -60(fp)
# %op10 = add i32 %op9, 1
	lw t0, -60(fp)
	addi t1, zero, 1
	add t2, t0, t1
	sw t2, -64(fp)
# store i32 %op10, i32* %op0
	ld t1, -24(fp)
	lw t0, -64(fp)
	sw t0, 0(t1)
# br label %label1
	j .readarray_label1
.readarray_label11:
# ret void
	j readarray_exit
readarray_exit:
	ld ra, 56(sp)
	ld s0, 48(sp)
	addi sp, sp, 64
	ret
	.globl transpose
	.type transpose, @function
transpose:
	addi sp, sp, -352
	sd ra, 344(sp)
	sd s0, 336(sp)
	addi s0, sp, 352
	sw a0, -20(fp)
	sd a1, -32(fp)
	sw a2, -36(fp)
.transpose_label_entry:
# %op3 = alloca i32
	li t0, 52
	sub t1, fp, t0
	sd t1, -48(fp)
# store i32 %arg0, i32* %op3
	ld t1, -48(fp)
	lw t0, -20(fp)
	sw t0, 0(t1)
# %op4 = alloca i32*
	li t0, 72
	sub t1, fp, t0
	sd t1, -64(fp)
# store i32* %arg1, i32** %op4
	ld t1, -64(fp)
	ld t0, -32(fp)
	sd t0, 0(t1)
# %op5 = alloca i32
	li t0, 84
	sub t1, fp, t0
	sd t1, -80(fp)
# store i32 %arg2, i32* %op5
	ld t1, -80(fp)
	lw t0, -36(fp)
	sw t0, 0(t1)
# %op6 = alloca i32
	li t0, 100
	sub t1, fp, t0
	sd t1, -96(fp)
# %op7 = alloca i32
	li t0, 116
	sub t1, fp, t0
	sd t1, -112(fp)
# %op8 = alloca i32
	li t0, 132
	sub t1, fp, t0
	sd t1, -128(fp)
# %op9 = alloca i32
	li t0, 148
	sub t1, fp, t0
	sd t1, -144(fp)
# %op10 = load i32, i32* %op3
	ld t0, -48(fp)
	lw t1, 0(t0)
	sw t1, -152(fp)
# %op11 = load i32, i32* %op5
	ld t0, -80(fp)
	lw t1, 0(t0)
	sw t1, -156(fp)
# %op12 = sdiv i32 %op10, %op11
	lw t0, -152(fp)
	lw t1, -156(fp)
	div t2, t0, t1
	sw t2, -160(fp)
# store i32 %op12, i32* %op6
	ld t1, -96(fp)
	lw t0, -160(fp)
	sw t0, 0(t1)
# store i32 0, i32* %op7
	ld t1, -112(fp)
	addi t0, zero, 0
	sw t0, 0(t1)
# store i32 0, i32* %op8
	ld t1, -128(fp)
	addi t0, zero, 0
	sw t0, 0(t1)
# br label %label13
	j .transpose_label13
.transpose_label13:
# %op14 = load i32, i32* %op7
	ld t0, -112(fp)
	lw t1, 0(t0)
	sw t1, -164(fp)
# %op15 = load i32, i32* %op6
	ld t0, -96(fp)
	lw t1, 0(t0)
	sw t1, -168(fp)
# %op16 = icmp slt i32 %op14, %op15
	lw t0, -164(fp)
	lw t1, -168(fp)
	slt t0,t0,t1
	sb t0, -169(fp)
# br i1 %op16, label %label17, label %label18
	lb t0, -169(fp)
	bnez t0, .transpose_label17
	j .transpose_label18
.transpose_label17:
# store i32 0, i32* %op8
	ld t1, -128(fp)
	addi t0, zero, 0
	sw t0, 0(t1)
# br label %label20
	j .transpose_label20
.transpose_label18:
# %op19 = sub i32 0, 1
	addi t0, zero, 0
	addi t1, zero, 1
	sub t2, t0, t1
	sw t2, -176(fp)
# ret i32 %op19
	lw a0, -176(fp)
	j transpose_exit
.transpose_label20:
# %op21 = load i32, i32* %op8
	ld t0, -128(fp)
	lw t1, 0(t0)
	sw t1, -180(fp)
# %op22 = load i32, i32* %op5
	ld t0, -80(fp)
	lw t1, 0(t0)
	sw t1, -184(fp)
# %op23 = icmp slt i32 %op21, %op22
	lw t0, -180(fp)
	lw t1, -184(fp)
	slt t0,t0,t1
	sb t0, -185(fp)
# br i1 %op23, label %label24, label %label28
	lb t0, -185(fp)
	bnez t0, .transpose_label24
	j .transpose_label28
.transpose_label24:
# %op25 = load i32, i32* %op7
	ld t0, -112(fp)
	lw t1, 0(t0)
	sw t1, -192(fp)
# %op26 = load i32, i32* %op8
	ld t0, -128(fp)
	lw t1, 0(t0)
	sw t1, -196(fp)
# %op27 = icmp slt i32 %op25, %op26
	lw t0, -192(fp)
	lw t1, -196(fp)
	slt t0,t0,t1
	sb t0, -197(fp)
# br i1 %op27, label %label31, label %label34
	lb t0, -197(fp)
	bnez t0, .transpose_label31
	j .transpose_label34
.transpose_label28:
# %op29 = load i32, i32* %op7
	ld t0, -112(fp)
	lw t1, 0(t0)
	sw t1, -204(fp)
# %op30 = add i32 %op29, 1
	lw t0, -204(fp)
	addi t1, zero, 1
	add t2, t0, t1
	sw t2, -208(fp)
# store i32 %op30, i32* %op7
	ld t1, -112(fp)
	lw t0, -208(fp)
	sw t0, 0(t1)
# br label %label13
	j .transpose_label13
.transpose_label31:
# %op32 = load i32, i32* %op8
	ld t0, -128(fp)
	lw t1, 0(t0)
	sw t1, -212(fp)
# %op33 = add i32 %op32, 1
	lw t0, -212(fp)
	addi t1, zero, 1
	add t2, t0, t1
	sw t2, -216(fp)
# store i32 %op33, i32* %op8
	ld t1, -128(fp)
	lw t0, -216(fp)
	sw t0, 0(t1)
# br label %label64
	j .transpose_label64
.transpose_label34:
# %op35 = load i32, i32* %op7
	ld t0, -112(fp)
	lw t1, 0(t0)
	sw t1, -220(fp)
# %op36 = load i32, i32* %op5
	ld t0, -80(fp)
	lw t1, 0(t0)
	sw t1, -224(fp)
# %op37 = mul i32 %op35, %op36
	lw t0, -220(fp)
	lw t1, -224(fp)
	mul t2, t0, t1
	sw t2, -228(fp)
# %op38 = load i32, i32* %op8
	ld t0, -128(fp)
	lw t1, 0(t0)
	sw t1, -232(fp)
# %op39 = add i32 %op37, %op38
	lw t0, -228(fp)
	lw t1, -232(fp)
	add t2, t0, t1
	sw t2, -236(fp)
# %op40 = getelementptr i32, i32* %arg1, i32 %op39
	ld t1, -32(fp)
	lw t0, -236(fp)
	add s11,t0 , t0
	add s11,s11,s11
	add t0,s11,t1
	sd t0, -248(fp)
# %op41 = load i32, i32* %op40
	ld t0, -248(fp)
	lw t1, 0(t0)
	sw t1, -252(fp)
# store i32 %op41, i32* %op9
	ld t1, -144(fp)
	lw t0, -252(fp)
	sw t0, 0(t1)
# %op42 = load i32, i32* %op7
	ld t0, -112(fp)
	lw t1, 0(t0)
	sw t1, -256(fp)
# %op43 = load i32, i32* %op5
	ld t0, -80(fp)
	lw t1, 0(t0)
	sw t1, -260(fp)
# %op44 = mul i32 %op42, %op43
	lw t0, -256(fp)
	lw t1, -260(fp)
	mul t2, t0, t1
	sw t2, -264(fp)
# %op45 = load i32, i32* %op8
	ld t0, -128(fp)
	lw t1, 0(t0)
	sw t1, -268(fp)
# %op46 = add i32 %op44, %op45
	lw t0, -264(fp)
	lw t1, -268(fp)
	add t2, t0, t1
	sw t2, -272(fp)
# %op47 = getelementptr i32, i32* %arg1, i32 %op46
	ld t1, -32(fp)
	lw t0, -272(fp)
	add s11,t0 , t0
	add s11,s11,s11
	add t0,s11,t1
	sd t0, -280(fp)
# %op48 = load i32, i32* %op47
	ld t0, -280(fp)
	lw t1, 0(t0)
	sw t1, -284(fp)
# %op49 = load i32, i32* %op8
	ld t0, -128(fp)
	lw t1, 0(t0)
	sw t1, -288(fp)
# %op50 = load i32, i32* %op6
	ld t0, -96(fp)
	lw t1, 0(t0)
	sw t1, -292(fp)
# %op51 = mul i32 %op49, %op50
	lw t0, -288(fp)
	lw t1, -292(fp)
	mul t2, t0, t1
	sw t2, -296(fp)
# %op52 = load i32, i32* %op7
	ld t0, -112(fp)
	lw t1, 0(t0)
	sw t1, -300(fp)
# %op53 = add i32 %op51, %op52
	lw t0, -296(fp)
	lw t1, -300(fp)
	add t2, t0, t1
	sw t2, -304(fp)
# %op54 = getelementptr i32, i32* %arg1, i32 %op53
	ld t1, -32(fp)
	lw t0, -304(fp)
	add s11,t0 , t0
	add s11,s11,s11
	add t0,s11,t1
	sd t0, -312(fp)
# store i32 %op48, i32* %op54
	ld t1, -312(fp)
	lw t0, -284(fp)
	sw t0, 0(t1)
# %op55 = load i32, i32* %op9
	ld t0, -144(fp)
	lw t1, 0(t0)
	sw t1, -316(fp)
# %op56 = load i32, i32* %op7
	ld t0, -112(fp)
	lw t1, 0(t0)
	sw t1, -320(fp)
# %op57 = load i32, i32* %op5
	ld t0, -80(fp)
	lw t1, 0(t0)
	sw t1, -324(fp)
# %op58 = mul i32 %op56, %op57
	lw t0, -320(fp)
	lw t1, -324(fp)
	mul t2, t0, t1
	sw t2, -328(fp)
# %op59 = load i32, i32* %op8
	ld t0, -128(fp)
	lw t1, 0(t0)
	sw t1, -332(fp)
# %op60 = add i32 %op58, %op59
	lw t0, -328(fp)
	lw t1, -332(fp)
	add t2, t0, t1
	sw t2, -336(fp)
# %op61 = getelementptr i32, i32* %arg1, i32 %op60
	ld t1, -32(fp)
	lw t0, -336(fp)
	add s11,t0 , t0
	add s11,s11,s11
	add t0,s11,t1
	sd t0, -344(fp)
# store i32 %op55, i32* %op61
	ld t1, -344(fp)
	lw t0, -316(fp)
	sw t0, 0(t1)
# %op62 = load i32, i32* %op8
	ld t0, -128(fp)
	lw t1, 0(t0)
	sw t1, -348(fp)
# %op63 = add i32 %op62, 1
	lw t0, -348(fp)
	addi t1, zero, 1
	add t2, t0, t1
	sw t2, -352(fp)
# store i32 %op63, i32* %op8
	ld t1, -128(fp)
	lw t0, -352(fp)
	sw t0, 0(t1)
# br label %label64
	j .transpose_label64
.transpose_label64:
# br label %label20
	j .transpose_label20
transpose_exit:
	ld ra, 344(sp)
	ld s0, 336(sp)
	addi sp, sp, 352
	ret
	.globl main
	.type main, @function
main:
	addi sp, sp, -240
	sd ra, 232(sp)
	sd s0, 224(sp)
	addi s0, sp, 240
.main_label_entry:
# %op0 = alloca i32
	li t0, 28
	sub t1, fp, t0
	sd t1, -24(fp)
# %op1 = alloca i32
	li t0, 44
	sub t1, fp, t0
	sd t1, -40(fp)
# %op2 = alloca i32
	li t0, 60
	sub t1, fp, t0
	sd t1, -56(fp)
# %op3 = call i32 @getint()
	jal getint
	sw a0, -64(fp)
# store i32 %op3, i32* %op0
	ld t1, -24(fp)
	lw t0, -64(fp)
	sw t0, 0(t1)
# %op4 = call i32 @getint()
	jal getint
	sw a0, -68(fp)
# store i32 %op4, i32* @len
	la t1, len
	lw t0, -68(fp)
	sw t0, 0(t1)
# call void @readarray()
	jal readarray
# store i32 0, i32* %op1
	ld t1, -40(fp)
	addi t0, zero, 0
	sw t0, 0(t1)
# br label %label5
	j .main_label5
.main_label5:
# %op6 = load i32, i32* %op1
	ld t0, -40(fp)
	lw t1, 0(t0)
	sw t1, -72(fp)
# %op7 = load i32, i32* %op0
	ld t0, -24(fp)
	lw t1, 0(t0)
	sw t1, -76(fp)
# %op8 = icmp slt i32 %op6, %op7
	lw t0, -72(fp)
	lw t1, -76(fp)
	slt t0,t0,t1
	sb t0, -77(fp)
# br i1 %op8, label %label9, label %label15
	lb t0, -77(fp)
	bnez t0, .main_label9
	j .main_label15
.main_label9:
# %op10 = load i32, i32* %op1
	ld t0, -40(fp)
	lw t1, 0(t0)
	sw t1, -84(fp)
# %op11 = load i32, i32* %op1
	ld t0, -40(fp)
	lw t1, 0(t0)
	sw t1, -88(fp)
# %op12 = getelementptr [20000000 x i32], [20000000 x i32]* @matrix, i32 0, i32 %op11
	la t1, matrix
	lw t0, -88(fp)
	li s11, 4
	li s10, 1
	mul t0, t0, s10
	mul t0, t0, s11
	add t1, t1, t0
	sd t1, -96(fp)
# store i32 %op10, i32* %op12
	ld t1, -96(fp)
	lw t0, -84(fp)
	sw t0, 0(t1)
# %op13 = load i32, i32* %op1
	ld t0, -40(fp)
	lw t1, 0(t0)
	sw t1, -100(fp)
# %op14 = add i32 %op13, 1
	lw t0, -100(fp)
	addi t1, zero, 1
	add t2, t0, t1
	sw t2, -104(fp)
# store i32 %op14, i32* %op1
	ld t1, -40(fp)
	lw t0, -104(fp)
	sw t0, 0(t1)
# br label %label5
	j .main_label5
.main_label15:
# store i32 0, i32* %op1
	ld t1, -40(fp)
	addi t0, zero, 0
	sw t0, 0(t1)
# br label %label16
	j .main_label16
.main_label16:
# %op17 = load i32, i32* %op1
	ld t0, -40(fp)
	lw t1, 0(t0)
	sw t1, -108(fp)
# %op18 = load i32, i32* @len
	la t0, len
	lw t1, 0(t0)
	sw t1, -112(fp)
# %op19 = icmp slt i32 %op17, %op18
	lw t0, -108(fp)
	lw t1, -112(fp)
	slt t0,t0,t1
	sb t0, -113(fp)
# br i1 %op19, label %label20, label %label29
	lb t0, -113(fp)
	bnez t0, .main_label20
	j .main_label29
.main_label20:
# %op21 = load i32, i32* %op0
	ld t0, -24(fp)
	lw t1, 0(t0)
	sw t1, -120(fp)
# %op22 = getelementptr [20000000 x i32], [20000000 x i32]* @matrix, i32 0, i32 0
	la t1, matrix
	addi t0, zero, 0
	li s11, 4
	li s10, 1
	mul t0, t0, s10
	mul t0, t0, s11
	add t1, t1, t0
	sd t1, -128(fp)
# %op23 = load i32, i32* %op1
	ld t0, -40(fp)
	lw t1, 0(t0)
	sw t1, -132(fp)
# %op24 = getelementptr [100000 x i32], [100000 x i32]* @ad, i32 0, i32 %op23
	la t1, ad
	lw t0, -132(fp)
	li s11, 4
	li s10, 1
	mul t0, t0, s10
	mul t0, t0, s11
	add t1, t1, t0
	sd t1, -144(fp)
# %op25 = load i32, i32* %op24
	ld t0, -144(fp)
	lw t1, 0(t0)
	sw t1, -148(fp)
# %op26 = call i32 @transpose(i32 %op21, i32* %op22, i32 %op25)
	lw a0, -120(fp)
	ld a1, -128(fp)
	lw a2, -148(fp)
	jal transpose
	sw a0, -152(fp)
# %op27 = load i32, i32* %op1
	ld t0, -40(fp)
	lw t1, 0(t0)
	sw t1, -156(fp)
# %op28 = add i32 %op27, 1
	lw t0, -156(fp)
	addi t1, zero, 1
	add t2, t0, t1
	sw t2, -160(fp)
# store i32 %op28, i32* %op1
	ld t1, -40(fp)
	lw t0, -160(fp)
	sw t0, 0(t1)
# br label %label16
	j .main_label16
.main_label29:
# store i32 0, i32* %op2
	ld t1, -56(fp)
	addi t0, zero, 0
	sw t0, 0(t1)
# store i32 0, i32* %op1
	ld t1, -40(fp)
	addi t0, zero, 0
	sw t0, 0(t1)
# br label %label30
	j .main_label30
.main_label30:
# %op31 = load i32, i32* %op1
	ld t0, -40(fp)
	lw t1, 0(t0)
	sw t1, -164(fp)
# %op32 = load i32, i32* @len
	la t0, len
	lw t1, 0(t0)
	sw t1, -168(fp)
# %op33 = icmp slt i32 %op31, %op32
	lw t0, -164(fp)
	lw t1, -168(fp)
	slt t0,t0,t1
	sb t0, -169(fp)
# br i1 %op33, label %label34, label %label46
	lb t0, -169(fp)
	bnez t0, .main_label34
	j .main_label46
.main_label34:
# %op35 = load i32, i32* %op2
	ld t0, -56(fp)
	lw t1, 0(t0)
	sw t1, -176(fp)
# %op36 = load i32, i32* %op1
	ld t0, -40(fp)
	lw t1, 0(t0)
	sw t1, -180(fp)
# %op37 = load i32, i32* %op1
	ld t0, -40(fp)
	lw t1, 0(t0)
	sw t1, -184(fp)
# %op38 = mul i32 %op36, %op37
	lw t0, -180(fp)
	lw t1, -184(fp)
	mul t2, t0, t1
	sw t2, -188(fp)
# %op39 = load i32, i32* %op1
	ld t0, -40(fp)
	lw t1, 0(t0)
	sw t1, -192(fp)
# %op40 = getelementptr [20000000 x i32], [20000000 x i32]* @matrix, i32 0, i32 %op39
	la t1, matrix
	lw t0, -192(fp)
	li s11, 4
	li s10, 1
	mul t0, t0, s10
	mul t0, t0, s11
	add t1, t1, t0
	sd t1, -200(fp)
# %op41 = load i32, i32* %op40
	ld t0, -200(fp)
	lw t1, 0(t0)
	sw t1, -204(fp)
# %op42 = mul i32 %op38, %op41
	lw t0, -188(fp)
	lw t1, -204(fp)
	mul t2, t0, t1
	sw t2, -208(fp)
# %op43 = add i32 %op35, %op42
	lw t0, -176(fp)
	lw t1, -208(fp)
	add t2, t0, t1
	sw t2, -212(fp)
# store i32 %op43, i32* %op2
	ld t1, -56(fp)
	lw t0, -212(fp)
	sw t0, 0(t1)
# %op44 = load i32, i32* %op1
	ld t0, -40(fp)
	lw t1, 0(t0)
	sw t1, -216(fp)
# %op45 = add i32 %op44, 1
	lw t0, -216(fp)
	addi t1, zero, 1
	add t2, t0, t1
	sw t2, -220(fp)
# store i32 %op45, i32* %op1
	ld t1, -40(fp)
	lw t0, -220(fp)
	sw t0, 0(t1)
# br label %label30
	j .main_label30
.main_label46:
# %op47 = load i32, i32* %op2
	ld t0, -56(fp)
	lw t1, 0(t0)
	sw t1, -224(fp)
# %op48 = icmp slt i32 %op47, 0
	lw t0, -224(fp)
	addi t1, zero, 0
	slt t0,t0,t1
	sb t0, -225(fp)
# br i1 %op48, label %label49, label %label52
	lb t0, -225(fp)
	bnez t0, .main_label49
	j .main_label52
.main_label49:
# %op50 = load i32, i32* %op2
	ld t0, -56(fp)
	lw t1, 0(t0)
	sw t1, -232(fp)
# %op51 = sub i32 0, %op50
	addi t0, zero, 0
	lw t1, -232(fp)
	sub t2, t0, t1
	sw t2, -236(fp)
# store i32 %op51, i32* %op2
	ld t1, -56(fp)
	lw t0, -236(fp)
	sw t0, 0(t1)
# br label %label52
	j .main_label52
.main_label52:
# %op53 = load i32, i32* %op2
	ld t0, -56(fp)
	lw t1, 0(t0)
	sw t1, -240(fp)
# call void @putint(i32 %op53)
	lw a0, -240(fp)
	jal putint
# ret i32 0
	addi a0, zero, 0
	j main_exit
main_exit:
	ld ra, 232(sp)
	ld s0, 224(sp)
	addi sp, sp, 240
	ret
